<html>
<head>
<script type="text/javascript"
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
	
<script type="text/javascript">


$(document).ready(
		function() {
			$("#button").click(
							function() {
								
								var jsonString ='{"updatedBy":{"nodeiD":null,"emailID":null,"trips":null,"updates":null,"friends":null,"favLocations":null,"name":"Sripaul","registered":false,"password":null},"forLocation":{"nodeiD":null,"updates":null,"name":"Madras"},"createdOn":null,"imgURL":"sample.jpeg","comments":[{"createdOn":null,"itHelps":null,"nodeiD":null,"commentedBy":{"nodeiD":null,"emailID":null,"trips":null,"updates":null,"friends":null,"favLocations":null,"name":"Prasad","registered":false,"password":null},"message":"This is a sample comment 2"},{"createdOn":null,"itHelps":null,"nodeiD":null,"commentedBy":{"nodeiD":null,"emailID":null,"trips":null,"updates":null,"friends":null,"favLocations":null,"name":"Satish","registered":false,"password":null},"message":"This is a sample comment 1"}],"itHelps":null,"message":"This is a sample update"}';
								var jsonParsed = jQuery.parseJSON(jsonString);
								
								alert(jsonParsed.updatedBy.name);
								
								var res="<div class='panel'><table><tr><td>"+jsonParsed.updatedBy.name+"</td><td>"+jsonParsed.forLocation.name+"</td></tr>";
								var commentPane="";
								for(var i=0;i<jsonParsed.comments.length;i++) {
								    var comment = jsonParsed.comments[i];
									commentPane+='<tr><td>'+comment.commentedBy.name+'</td>';
									commentPane+='<td>'+comment.message+'</td></tr>';
								}
								res+=commentPane;
								$("#updatePane").html(res+'</table></p></div>');
								//$("div").css("background-color","yellow");
							});
		});

</script>
<style type="text/css">
.panel{
	margin: 0px;
	padding: 5px;
	text-align: center;
	background: #e5eecc;
	border: solid 1px #c3c3c3;
}

div.panel {
	height: 120px;
	background: #e5eecc;
	border: solid 1px #c3c3c3;
}
</style>
</head>
<body>
<div id="updatePane">

</div>
<button id="button">Test</button>
</body>
</html>